﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Pampa.Grid.UI.CustomControls;
using Pampa.MVC.Fluent.Common;

namespace Pampa.MVC.Fluent.Grid
{
    public class BasicPagerBuilder : IHtmlString
    {
        private string _gridId;
        private string _pageText;
        private string _ofText;

        public BasicPagerBuilder GridClientId(string gridId)
        {
            _gridId = gridId;
            return this;
        }

        public BasicPagerBuilder PageText(string pageText)
        {
            _pageText = pageText;
            return this;
        }

        public BasicPagerBuilder OfText(string ofText)
        {
            _ofText = ofText;
            return this;
        }

        public string  ToHtmlString()
        {
            var pager = new BasicPager();
            pager.ID = "pager" + _gridId;
            pager.GridID = _gridId;
            pager.CssClass = "pager";
            pager.PageText = _pageText;
            pager.FromText = _ofText;
            return pager.Render();
        }
    }
}
